{extend name="common/base" }

{block name="content"}
<div class="am-g">
	<div class="am-u-sm-12 am-u-md-6">
		<div class="am-btn-toolbar">
			<div class="am-btn-group am-btn-group-xs">
				<a class="am-btn am-btn-default" href="{:url('add')}">
					<span class="am-icon-plus"></span> 新增
				</a>
				<a class="am-btn am-btn-default nd-refresh">
					<span class="am-icon-refresh"></span> 刷新
				</a>
			</div>
		</div>
	</div>
</div>
<br/>

<div class="am-g">
	<div class="am-u-sm-12">
		<table class="am-table am-table-striped am-table-radius am-table-bordered">
			<thead>
				<tr>
					<th>用户名</th>
					<th>登录IP</th>
					<th>登录次数</th>
					<th>登录时间</th>
					<th>分组</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			{volist name="_list" id="vo"}
				<tr>
					<td>{$vo.user_name}</td>
					<td>{$vo.login_ip}</td>
					<td>{$vo.login_count}</td>
					<td>{$vo.login_time|date='Y-m-d H:i:s',###}</td>
					<td>
						{$widget->row('select', ['value' => $vo['user_gid'], 'list' => $group_list, 'url' => url('modify', ['id' => $vo['id'], 'field' =>  'user_gid'])])}
					</td>
					<td>
						{$widget->row('select', ['value' => $vo['user_status'], 'list' => $status_list, 'url' => url('modify', ['id' => $vo['id'], 'field' =>  'user_status'])])}
					</td>
					<td>
						<div class="am-btn-toolbar">
							<div class="am-btn-group am-btn-group-xs">
								{$widget->row('button', ['title' => '日志', 'class' => 'am-text-success', 'icon' => 'am-icon-table', 'url' => url('user_login/index', ['uid' => $vo['id']])])}
                                {$widget->row('button', ['title' => '编辑', 'class' => 'am-text-secondary', 'icon' => 'am-icon-pencil-square-o', 'url' => url('edit', ['id' => $vo['id']])])}
                                {$widget->row('button', ['title' => '删除', 'class' => 'am-text-danger ajax-get ajax-confirm', 'icon' => 'am-icon-trash-o', 'url' => url('delete', ['id' => $vo['id']])])}
							</div>
						</div>
					</td>
				</tr>
			{/volist}
			</tbody>
		</table>
		
		{if condition="!empty($_page)"}
            <div class="am-fl">共 {$_total} 条记录</div>
            <div class="am-fr">{$_page}</div>
        {/if}
	</div>
</div>
{/block}